package com.ruoyi.business.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;
import java.util.List;

import com.ruoyi.business.dao.CustomerDao;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.CustomerMapper;
import com.ruoyi.business.domain.Customer;
import com.ruoyi.business.service.ICustomerService;
/**
 * customerService业务层处理
 *
 * @author honor
 * @date 2025-04-28
 */
@Service
@RequiredArgsConstructor
public class CustomerServiceImpl  implements ICustomerService {

    private final CustomerDao customerDao;

    /**
     * 查询customer
     *
     * @param id customer主键
     * @return customer
     */
    @Override
    public Customer selectCustomerById(String id) {
        return customerDao.getById(id);
    }
    /**
     * 查询customer列表
     *
     * @param customer customer
     * @return customer
     */
    @Override
    public List<Customer> selectCustomerList(Customer customer) {
        return customerDao.selectCustomerList(customer);
    }
    /**
     * 新增customer
     *
     * @param customer customer
     * @return 结果
     */
    @Override
    public boolean insertCustomer(Customer customer) {
        return customerDao.save(customer);
    }
    /**
     * 修改customer
     *
     * @param customer customer
     * @return 结果
     */
    @Override
    public boolean updateCustomer(Customer customer) {
        return customerDao.updateById(customer);
    }
    /**
     * 批量删除customer
     *
     * @param ids 需要删除的customer主键
     * @return 结果
     */
    @Override
    public boolean deleteCustomerByIds(String[] ids) {
        return customerDao.removeByIds(Arrays.asList(ids));
    }
    /**
     * 删除customer信息
     *
     * @param id customer主键
     * @return 结果
     */
    @Override
    public boolean deleteCustomerById(String id) {
        return customerDao.removeById(id);
    }
}